home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / tcdebug6.zip / TCDEBUG.DOC < prev    next >
Text File  |  1987-11-05  |  28KB  |  991 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                                           November 5, 1987
  9.  
  10.                              TCdebug Version 0.06
  11.  
  12.                     (C) Copyright 1987 by L. David Baldwin.  
  13.                              All Rights Reserved.
  14.  
  15.   Further copyright information given below
  16.  
  17.  
  18.   OVERVIEW
  19.  
  20.   TCdebug is an experimental source code debugger for use in debugging Turbo 
  21.   C (tm) Programs on the IBM-PC (tm).  Its goal is to allow source code 
  22.   debugging in all of Turbo C's memory models and with most of the possible 
  23.   compile and link options.  TCdebug allows you to:
  24.  
  25.        1.  View your source code (and, optionally, the assembly language 
  26.            code) while debugging.
  27.        2.  Trace the operation of your program by source code lines or by 
  28.            assembly language instructions.
  29.        3.  Insert breakpoints in your program by function name, by line 
  30.            number, or hexadecimal address.
  31.        4.  Examine (and change) simple global variables by symbolic name.  
  32.            Local variables may also be examined and changed, but require that 
  33.            the proper displacement on the stack be known. 
  34.        5.  Set up a Watch window to keep continuous tabs on a variable.
  35.  
  36.   TCdebug is not a finished program.  It is being released at this time to 
  37.   get an indication of interest and to obtain assistance in finding bugs and 
  38.   other problems.
  39.  
  40.   TCdebug is designed exclusively for debugging Turbo C programs.  It should 
  41.   not be used on programs generated by other compilers.
  42.  
  43.  
  44.   SYSTEM REQUIREMENTS
  45.  
  46.        1.  An IBM-PC, AT, or compatible.  Screen compatibility is a must.
  47.        2.  PC-DOS 2.0 or above.
  48.        3.  Approximately 135k more memory than would normally be required to 
  49.            run the program to be tested.
  50.  
  51.  
  52.   PREPARATION
  53.  
  54.   TCdebug requires that a Map file for your program be present to supply 
  55.   information on the program symbols and line number locations.  When 
  56.   compiling and linking with TC, the options can be set with O/C/C/L and 
  57.   O/L/M/P.  With TCC use -M and -y.
  58.  
  59.  
  60.  
  61.  
  62.                                       1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   It is also highly desirable that the program to be tested be compiled with 
  75.   the 'standard stack frame' option on.  Using TC, set this option with 
  76.   O/C/C/S.  With TCC, use -k (The manual says -Y but that's apparently a 
  77.   typo).
  78.  
  79.   When starting a debugging session, the following files should be on the 
  80.   default drive:
  81.  
  82.     PROG.EXE    (or, optionally, .COM for the Tiny Model)
  83.     PROG.MAP    the map file
  84.     various.C   all the source files for the program (or at least all that 
  85.                 will be accessed.)
  86.  
  87.  
  88.  
  89.   OPERATION
  90.  
  91.   TCdebug may be started by entering the filename of the program to be 
  92.   debugged and any parameters which it requires on the command line, as:
  93.  
  94.     TCdebug PROG <other stuff>
  95.  
  96.   Here, PROG is the name of the program to be tested with EXE being the 
  97.   default extension.  <other stuff> will be passed on to PROG as its command 
  98.   line when execution begins.  If TCdebug is called without parameters, a 
  99.   request will be made for them.
  100.  
  101.   When execution begins, TCdebug loads the Map file, the EXE file and reports 
  102.   some facts about the program.  Note should be made of whether pointers are 
  103.   regarded as Near or Far by default as this will be important when 
  104.   displaying pointers later.
  105.  
  106.   After "hitting any key", the program is executed to "main()" and the 
  107.   debugging screen appears.  The debugging screen is divided into two parts.  
  108.   The lower section is the command and data section.  The '*' is a prompt for 
  109.   one of the commands described later.  The top part of the screen displays 
  110.   the program source code text which at this point will be centered at the 
  111.   first statement in main().  Source code line numbers appear at the left 
  112.   with the current line (the one to be executed next) being highlighted.
  113.  
  114.   Dividing the two portions of the debugging screen is a line which shows the 
  115.   name of the source file presently displayed.
  116.  
  117.   Two keys which can be tried at this point are the F9 and F10 keys.  The 
  118.   F9 key toggles into and out of the assembly mode.  When in assembly mode, 
  119.   the assembly language instructions of the program are displayed with the 
  120.   source code lines interspersed.  The F10 key toggles between the debugger 
  121.   screen and the screen which receives program output.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                       2
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   SPECIAL KEYS FOR VIEWING TEXT
  141.  
  142.   The following keys may be used to change the text being displayed:
  143.  
  144.        Pg Up
  145.        Pg Dn       Move the display up or down one page.
  146.  
  147.        ^Pg Up
  148.        ^Pg Dn      Move to the start or end of the current file.
  149.  
  150.        Up arrow
  151.        Down arrow  Scroll up or down one line.
  152.  
  153.        ^Left Arrow  (with Scroll Lock on)
  154.        ^Right Arrow (with Scroll Lock on)
  155.                    Scroll horizontally left and right.
  156.  
  157.        F9 key      Toggle in and out of assembly mode.
  158.  
  159.        F10 key     Toggle between the debug screen and the screen
  160.                    of the program under test.
  161.  
  162.        Alt-U       Move dividing line up one line.
  163.        Alt-D       Move dividing line down one line.
  164.  
  165.   Note that the toggling of the Scroll Lock key effects the action of some of 
  166.   the special keys.  The text display may also be changed using the View 
  167.   command described later.
  168.  
  169.  
  170.   COMMAND EDITOR
  171.  
  172.   Commands are entered at the '*' prompt.  When entering commands, the 
  173.   following keys may used to edit the command:  (They perform the same 
  174.   functions as they do in the Turbo C editor.)
  175.  
  176.        ^A,^S,^D,^F,^G,^T,^H,^V,^Y,LFARW,RTARW,^LFARW,^RTARW,
  177.        Ins, Del, Backspace
  178.  
  179.   The Insert mode (default) is indicated by a slightly fatter cursor.  The 
  180.   cursor is normal in the Overwrite mode.
  181.  
  182.   In addition, a stack of the last 6 commands (those having more than 3 
  183.   characters) is maintained.  The F3 key accesses the stored commands from 
  184.   the most recent to the oldest and the F5 key accesses them in the reverse 
  185.   order.  These old commands may be used as is or may be modified by editing 
  186.   them.
  187.  
  188.   Note that commands are not acted upon until the Enter key is hit.  (The 
  189.   cursor does not have to be at the line end to enter the command.)
  190.  
  191.  
  192.  
  193.  
  194.                                       3
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   COMMAND PARAMETERS
  207.  
  208.   TCdebug uses one or two letter commands.  The command is often followed by 
  209.   one or more parameters.  Parameters are delimited from the command and each 
  210.   other using spaces.  The one exception to this is the format parameter 
  211.   which is preceded by a comma.  The parameters which may be used are:
  212.  
  213.     <Symbol>
  214.        A C source code symbol representing a function name or variable as 
  215.        appropriate.  The leading underbar added by the compiler has been 
  216.        stripped off, so symbols are entered exactly as used in the source 
  217.        program.  Case is significant (unless the non case sensitive link 
  218.        option was selected).
  219.  
  220.        The special symbols, _AX, _AL, _BX, etc. may be used to refer to the 
  221.        hardware registers.
  222.  
  223.        A special symbol, rtn (or RTN), refers to the return address of the 
  224.        current function.  For this symbol to function reliably, the program 
  225.        should be compiled with the 'standard stack frame' option on.  
  226.        Currently, this symbol can only be accessed if the current CS:IP is on 
  227.        an exact source line number.
  228.  
  229.          Examples:
  230.            V rtn    Find out who called this function.
  231.            G RTN    Execute the remainder of this function, return to caller.
  232.  
  233.  
  234.     <Line Number>
  235.        Line numbers are entered as <filename>\<number> as:
  236.            myprog.c\345
  237.  
  238.        In most cases, the <filename> part can be dropped.  An entry of the 
  239.        form
  240.  
  241.            \345
  242.  
  243.        implies line number 345 in the currently displayed source file.  
  244.        (Currently, the '\' also may be dropped and a simple decimal entry will 
  245.        do.  However, the '\' may be required in future versions.)
  246.  
  247.     <Hexaddress>
  248.        Normal numerical entry in TCdebug is decimal with hex entries allowed 
  249.        by preceding them with '0x' or '$'.  However, numerical address 
  250.        entries must be entered in hex to distinguish them from line numbers.  
  251.        A <hexaddress> takes the following form:
  252.  
  253.            0x1234:0x1ABC
  254.            es:bx+2
  255.            SS:BP-0X5a
  256.  
  257.  
  258.  
  259.  
  260.                                       4
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.        As indicated above, register names are allowed in address 
  273.        specifications.  The _current_ value in the register is used--the 
  274.        address does not change if the register value later changes.  The 
  275.        segment part of the <hexaddress> may be dropped as in:
  276.  
  277.            bp-0xA
  278.            0x123
  279.            bx
  280.  
  281.        If no segment is present in the entry, there is an implied segment.  
  282.        The rules for determining the implied segment are:
  283.  
  284.        1.  If the BP register is used, SS is implied.
  285.        2.  If BX,SI,DI are used (but not BP), DS is implied.
  286.        3.  If none of the above and a data entry is expected, DS is implied.
  287.        4.  If a code address is expected, the current CS is implied.
  288.  
  289.     <Format>
  290.        Format parameters are entered as one or two letters preceded by a 
  291.        comma.  Case is significant.  The purpose of the <format> parameter is 
  292.        to inform TCdebug of the size and type of a variable as this 
  293.        information is not available in the Map file.  <format> parameters 
  294.        correspond to those used in the C 'printf' function.  Currently 
  295.        supported are:
  296.  
  297.            c,s,i,d,u,x,X,o,p,g,G,li,ld,lx,lX,lo,Np,Fp,lg,lG
  298.  
  299.        For the p (pointer) format, the default pointer size for the selected 
  300.        memory model is used.  This size is indicated in the information 
  301.        presented at startup.  To override the default, use either N or F as 
  302.        appropriate.
  303.  
  304.        The c (character) format has been used as a catchall for byte size 
  305.        items.  Display is in quoted character form, decimal, and hex.  Change 
  306.        entries may be made using any of those forms.
  307.  
  308.  
  309.   COMMANDS
  310.  
  311.   G    (Go)
  312.  
  313.     Format:
  314.        G [<parameter> [<parameter..]]
  315.  
  316.     The Go command starts execution of the program under test.  Execution 
  317.     will continue until a breakpoint is reached or the program terminates.
  318.  
  319.     One or more breakpoints may be entered with the Go command.  These 
  320.     breakpoints are called temporary breakpoints as they are in effect only 
  321.     until the first stopping point is reached.  Any temporary breakpoint 
  322.     would then have to reentered with the next Go command if desired.
  323.  
  324.  
  325.  
  326.                                       5
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.     Examples:
  339.  
  340.        G   Start execution with no temporary breakpoints. (There might be 
  341.            some permanent breakpoints, however.)
  342.  
  343.        G \345 funct1 0x113
  344.            Start execution with temporary breakpoints at line number 345, at 
  345.            the start of function, funct1, and at address CS:0x113. In 
  346.            addition, there might be other permanent breakpoints in effect.
  347.  
  348.   T    (Trace)
  349.  
  350.     Format:
  351.        T   (or F7 key)
  352.  
  353.     In source code mode, execute the code on the current line.  Execution 
  354.     will stop at the next encountered line number.  If the current line 
  355.     contains a function call, the break will be at the start of the 
  356.     function.
  357.  
  358.     In assembly mode (assembly code is displayed), execute the next assembly 
  359.     language instruction.
  360.  
  361.  
  362.   N    (Next)
  363.  
  364.     Format:
  365.        N    (or F8 key)
  366.  
  367.     In either the source code or assembly mode, Next will execute the 
  368.     program, stopping at the next line number.
  369.  
  370.     The difference between the Trace and the Next command is that, if the 
  371.     current line contains a function call, Next will completely execute the 
  372.     function whereas Trace will Trace through the function.
  373.  
  374.  
  375.   P    (Permanent breakpoint)
  376.  
  377.     Format:
  378.        [-]P [<parameter>]  [<pass count>]
  379.  
  380.     The P command is used to specify permanent breakpoints.  Unlike temporary 
  381.     breakpoints, permanent breakpoints remain in effect until removed (using 
  382.     a '-' preceding the P command).  
  383.  
  384.     If no parameter is entered, the breakpoints in effect are listed.
  385.  
  386.     An optional pass count may be included when adding a breakpoint.  The 
  387.     pass count indicates how many times the breakpoint will be passed 
  388.     before the program is actually interrupted.
  389.  
  390.  
  391.  
  392.                                       6
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.     Examples:
  405.  
  406.        P              List all permanent breakpoints.
  407.       -P              Delete all permanent breakpoints.
  408.        P moda.c\345   Install a breakpoint at line 345 in file moda.c.
  409.       -P funct1       Remove a breakpoint at function funct1.
  410.        P 0x34b 10     Install a breakpoint at CS:034B.  The break will
  411.                       occur at the 11th execution of the instruction.
  412.  
  413.  
  414.   BE, BC      (Conditional Breakpoints)
  415.  
  416.     Formats:
  417.        BE <parameter>, <format> <value>   (Break when Equal to value)
  418.        BC <parameter>, <format>           (Break when there is a Change)
  419.        B                                  (List conditional breakpoints)
  420.       -B  [<number>]                      (delete one or more conditionals)
  421.  
  422.     Conditional breakpoints allow TCdebug to interrupt program execution 
  423.     whenever it finds that a variable has changed or becomes equal to a 
  424.     specified value.  TCdebug checks each one of the conditional breakpoints 
  425.     whenever it regains control of the program.  Normally, when using 
  426.     conditional breakpoints, the GT (Go in Trace mode) command should be used 
  427.     to allow the variable checks to be made at each source line.
  428.  
  429.     String variables are compared over the first 10 characters.
  430.  
  431.     Examples:
  432.  
  433.        BC str,s        Break when the string variable, str, changes.
  434.        BE *np,i  39    Break when the integer pointed to by np equals 39.
  435.        -B2             Delete conditional breakpoint #2.       
  436.       
  437.  
  438.   GT   (Go in Trace mode)
  439.  
  440.     Format:
  441.        GT [<parameter> [<parameter..]]
  442.  
  443.     The GT command is a special version of the G (Go) command for use with 
  444.     conditional breakpoints.  Both commands have the same syntax.  When the 
  445.     GT command is used, the execution of the program is interrupted briefly 
  446.     at each source line so that the specified conditions can be checked.  
  447.  
  448.     Because of the extra overhead involved with the GT command, program 
  449.     execution is very much slower than with the G command.
  450.  
  451.     Example:
  452.        GT \334   
  453.            Start execution of the program stopping at the first occurrence of: 
  454.            line 334, reaching a permanent breakpoint, or one of the 
  455.            conditions specified by a conditional breakpoint.       
  456.  
  457.  
  458.                                       7
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.   V    (View text)
  473.  
  474.     Format:
  475.        V [<parameter>]
  476.  
  477.     The View command may be used to change the text being observed in the 
  478.     text window.  If no parameter is entered, the text will be centered 
  479.     around the current line.
  480.  
  481.     In assembly mode, code for which there is no source may be viewed by 
  482.     specifying a hex address with the V command.
  483.  
  484.     Examples:
  485.  
  486.        V initscreens   View text at function initscreens.
  487.        V \545          View text around line 545.
  488.        V 0x1234:0xABCD Display instructions at 1234:ABCD (Assembly mode)
  489.  
  490.  
  491.   VF   (View File)
  492.  
  493.     Format:
  494.        VF <filename>
  495.  
  496.     The View command is for viewing the program source files.  The VF 
  497.     command allows any ASCII file to be displayed.
  498.  
  499.  
  500.   E    (Examine/change variable) 
  501.  
  502.     Format:
  503.        E <symbol>|<hexaddress> , <format>
  504.  
  505.     The Examine/change command allows the the value of a simple variable to 
  506.     be displayed and optionally changed.  Global variables may be referred to 
  507.     symbolically.  Auto and static variables must be referred to by a 
  508.     <hexaddress>.  Pointers may be resolved using one or more '*'s preceding 
  509.     the symbol or address.  Single dimensioned arrays may be examined using 
  510.     the normal '[..]' to enclose the array index.  <format> indicates the 
  511.     type of display wanted.
  512.  
  513.     After a variable value is displayed in response to the Examine/change 
  514.     command, a new value may be optionally entered followed by the Enter key.  
  515.     The Enter key by itself is used if no new value is desired.
  516.  
  517.     String variables are displayed as a string within quotes.  When 
  518.     specifying a change to a string variable, the new string should be 
  519.     enclosed in double quotes.  A null string is specified by two quotes 
  520.     enclosing nothing.
  521.  
  522.  
  523.  
  524.                                       8
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.     Examples:
  538.  
  539.        E flt,g
  540.        E dble,lg
  541.        E *st,c
  542.        E es:bx,u
  543.        E bp-0x52, s
  544.        E s[22],c
  545.        E *pt[3],i   the 4th element of the integer array pointed to by pt.
  546.  
  547.     When referring to registers, note that there is a difference between the 
  548.     register symbols with underbars and those without the underbars, so that:
  549.  
  550.        E ds:bx,x  Examine/change the hex integer at the address ds:bx.
  551.        E bx,x     The same thing (DS is implied).
  552.        E _BX,x    Examine/change the BX register.
  553.  
  554.  
  555.   W    Watch variable
  556.  
  557.     Format:
  558.        W <symbol>|<hexaddress> , <format>
  559.     [-]W [<number>]
  560.  
  561.     The Watch command opens up a watch window so that the specified variable 
  562.     is displayed continuously.  The value displayed is updated whenever 
  563.     TCdebug regains control.  The syntax for watch variable entry is 
  564.     identical to that used with the Examine command.  
  565.  
  566.     When watch variables are displayed, they are given a number.  The number 
  567.     is useful for selectively deleting them using the -W command.
  568.  
  569.     Examples:
  570.        W var1, u    Watch the unsigned variable, var1
  571.        W *bp-4,c    Watch the char variable pointed to by SS:BP-4
  572.        W _AL,c      Watch the AL register
  573.       -W 1          Delete watch variable #1
  574.       -W            Delete all watch variables  
  575.  
  576.  
  577.   D    (Display Memory)
  578.  
  579.     Format:
  580.        D <symbol>|<hexaddress> , <format>
  581.       -D
  582.  
  583.     The Display command opens up a three line display window displaying 
  584.     memory contents at the address given by <parameter> in the format given 
  585.     by <format>.  This display window may be scrolled using the following 
  586.     keys when Scroll Lock is toggled on:
  587.  
  588.  
  589.  
  590.                                       9
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.        Up Arrow
  603.        Down Arrow    Move up or down one line (Scroll Lock on)
  604.  
  605.        Pg Up
  606.        Pg Dn         Move up or down two lines (Scroll Lock on)
  607.  
  608.     Examples:
  609.  
  610.        D ptrs,Fp   Display memory at ptrs in far pointer format.
  611.        D dbles,lG  Display memory at dbles in double format.
  612.        D *es:bx,s  Display memory as pointed to by es:bx in string or 
  613.                    character format.
  614.       -D           Close the display window.
  615.  
  616.  
  617.   X    (Translate symbols to addresses or addresses to symbols)
  618.  
  619.     Format:
  620.        X <symbol>
  621.        X <address>
  622.  
  623.     The X command allows the address associated with a symbol to be 
  624.     determined or vice versa.
  625.  
  626.  
  627.   R    (Register Display)
  628.  
  629.     Format:
  630.        R
  631.  
  632.     The Register display command displays the current machine register 
  633.     contents.  
  634.  
  635.  
  636.   RE   (Restart program under test)
  637.  
  638.     Format:
  639.        RE
  640.  
  641.     Reloads a fresh version of the test program and restarts it from the 
  642.     beginning.  Breakpoints and watch variables remain in effect.
  643.  
  644.  
  645.   WD   (Window Divide)
  646.  
  647.     Format:
  648.        WD [n]
  649.  
  650.     The Window Divide command allows the line dividing the screen to be moved 
  651.     up or down.  n is the desired line position.  If n is not entered, the 
  652.     line position is not changed but the screen is refreshed.
  653.  
  654.  
  655.  
  656.                                      10
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.     The line dividing the screen may also be moved one line at a time using 
  669.     Alt-U (Up) or Alt-D (Down).
  670.  
  671.   TA   (Tab Size)
  672.  
  673.     Format
  674.        TA n
  675.  
  676.     Text displayed in the text window has tabs expanded to eight spaces by 
  677.     default.  The TAb command allows the expansion to be changed.
  678.  
  679.  
  680.   Q    (Quit)
  681.  
  682.     Format:
  683.        Q
  684.  
  685.     The Quit command ends debugging without running the program under test to 
  686.     completion.  However, the program's exit() routine is executed, so that 
  687.     files are closed, etc.  You will be asked if you wish to restart the 
  688.     program.  (Use F10 to check the program screen at this time if desired.)
  689.  
  690.  
  691.   DG   (DebuG)
  692.  
  693.     Format:
  694.        DG
  695.  
  696.     This command is used to enter an optional external assembly language 
  697.     debugger.  It is used mainly for debugging TCdebug.
  698.  
  699.  
  700.   HINTS
  701.  
  702.   It is possible to insert breakpoints in the source code using 
  703.   geninterrupt(3).  These breakpoints cannot be removed by TCdebug but may be 
  704.   useful for conditional breaks.  For instance:
  705.  
  706.     if (i==49) geninterrupt(3);
  707.  
  708.   If you mistakenly Trace into a function you wanted to skip using Next, use 
  709.   G rtn.  Actually, it's best to do a V rtn first to make sure that the 'rtn' 
  710.   symbol is working correctly.
  711.  
  712.   If, in the assembly mode, you trace into a library routine and can't find 
  713.   your way out, toggle out of assembly mode (F9).  Even if the source code 
  714.   screen is blank at this time, a single Trace will get you to the next line 
  715.   number.
  716.  
  717.   Avoid assembly tracing of the 8087 emulation code.
  718.  
  719.   Auto (stack) variables can be Examined or Watched by using the disassembly 
  720.  
  721.  
  722.                                      11
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.   listing to determine their position on the stack relative to the BP 
  735.   register.  When doing this, be sure that the BP register is valid.  In 
  736.   particular, the BP register is not valid immediately on entry to the 
  737.   function.  One source line trace must be made (or several assembly 
  738.   instructions passed) before the BP register is correct.
  739.  
  740.   The Huge memory model has the same sort of problem with the DS register 
  741.   which changes between modules.  In this case, it only effects the 
  742.   disassembly listing.  The data symbols will not be correctly listed until 
  743.   the DS register has been setup.
  744.  
  745.  
  746.   RESTRICTIONS, PROBLEMS, BUGS
  747.  
  748.   The following are current limits (somewhat arbitrarily set).  
  749.  
  750.     Permanent and temporary breakpoints are limited to 5 each.
  751.     Maximum file size for displayed files = 40k.
  752.     Maximum number of line numbers (only those with code count) = 3000.
  753.     Maximum number of program modules accommodated = 20.
  754.     Maximum number of symbols = 700.
  755.     Maximum number of watch variables = 4
  756.     Maximum number of conditional breakpoints = 3
  757.  
  758.   A simple screen swap is currently used.  This limits debugging to text only 
  759.   programs.  Snow may be horrendous at this time.
  760.  
  761.   The map file for the Tiny memory model has some peculiarities in data 
  762.   addresses which I haven't got figured out yet.  This affects a number of 
  763.   library data symbols but only seems to affect one or two source symbols.  
  764.   The problem shows up in the assembly listing where the affected symbols are 
  765.   not correctly displayed.
  766.  
  767.   The 8087 emulation code turns into a mess when disassembly is attempted.
  768.  
  769.   Currently, non default pointers cannot be resolved by the 'E' or 'W' 
  770.   commands.  That is:
  771.  
  772.     E *st,c
  773.  
  774.   will always resolve st as a far pointer if the default is far.  Probably 
  775.   some sort of cast will have to allowed, as:
  776.  
  777.     E *(near*)st,c
  778.  
  779.  
  780.   COPYRIGHT
  781.  
  782.   Documentation and Program (C) Copyright 1987 by L. David Baldwin.  
  783.   All Rights Reserved.
  784.  
  785.  
  786.  
  787.  
  788.                                      12
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.   TCdebug may be copied and distributed freely by individuals to friends and 
  801.   acquaintances providing that no fee is charged and it is not part of a 
  802.   package for which a charge is made.
  803.  
  804.   Please do not upload TCdebug to any bulletin board unless you are willing 
  805.   to keep it updated and report back problems.
  806.  
  807.  
  808.   TRADEMARKS
  809.  
  810.        IBM-PC is a trademark of International Business Machines 
  811.        Corporation.
  812.        Turbo C is a trademark of Borland International Inc.
  813.  
  814.  
  815.  
  816.   Please report all bugs, suggestions, and problems to Dave 
  817.   Baldwin, CompuServe ID #76327,53.
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                                      13
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.   APPENDIX A -- COMPILER OPTIONS
  867.  
  868.   As mentioned earlier, it is mandatory that the map file generation and line 
  869.   number options be turned on.  The effect of some of the other compiler 
  870.   options on debugging are discussed below.  Some of this is just guess work 
  871.   at this stage as not all have actually been tested.
  872.  
  873.   Standard Stack Frame
  874.     This option is highly desirable as the BP register must be set up in 
  875.     order for the 'rtn' symbol to work.  If this option is not used, any 
  876.     function which has many auto variables will still have a standard stack 
  877.     frame, so it is still possible to use 'rtn' in some cases.  The safest 
  878.     method is to do a V rtn or X rtn first to see if the return address makes 
  879.     sense before committing yourself to a G rtn.
  880.  
  881.   Register Optimization
  882.     Borland suggests off.  I haven't tried this one but I suspect that it 
  883.     confuses things somewhat.  Those adept at assembly language may not have 
  884.     too much trouble.
  885.  
  886.   Jump Optimization
  887.     Same as register optimization.
  888.  
  889.   80186/80286 Code Generation
  890.     Off is best here.  The disassembler in TCdebug currently does not 
  891.     understand the new instructions.
  892.  
  893.   Use Register Variables
  894.     When this option is on, you may have to figure out which variables the 
  895.     compiler decided to store in registers.  
  896.  
  897.   8087 vs Emulation
  898.     If you have a choice, by all means select straight 8087.  The emulated 
  899.     code does not disassemble in any meaningful way.
  900.  
  901.   Non Case Sensitive Link
  902.     If this option is selected, symbols will appear in uppercase.  Symbol 
  903.     entries may be made in either case.
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.                                      14
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.   APPENDIX B -- SOURCE CODE FORMATTING
  933.  
  934.   With modern compilers, line numbers often do not correspond to the code 
  935.   generated in the manner that you might expect.  Layout of the source code 
  936.   can help in this respect.  While you probably don't want to reformat all 
  937.   your present code, you may want to change your formatting for code yet to 
  938.   be written.
  939.  
  940.   The most obvious format change is to only have one source statement per 
  941.   line.  With more than one statement on a line, line numbers can't be used 
  942.   to set a breakpoint on the second statement and the Trace command will 
  943.   trace multiple statements.
  944.  
  945.   Statements split between two lines do not cause much trouble.
  946.  
  947.   The 'else' in an 'if' statement causes a difficulty.  Consider the 
  948.   following code:
  949.  
  950.   100  if (...)
  951.   101     {..do something..}
  952.   102  else {..do something else..}
  953.   103
  954.  
  955.   To put a breakpoint on the ..do something else.. one might try a break on 
  956.   line 102.  But the else here actually generates a jump instruction (to line 
  957.   103) so ..do something else.. is inaccessible except by using a code 
  958.   hexaddress.  A better format is:
  959.  
  960.   100  if (...)
  961.   101     {..do something..}
  962.   102  else 
  963.   103     {..do something else..}
  964.   104
  965.  
  966.   The 'for' statement also causes problems.  The decision code for the 'for' 
  967.   statement is actually done at the bottom of the loop and often is included 
  968.   as part of the next line where you would normally think the statement was 
  969.   completed.  The best solution here is to add a blank line after the 'for' 
  970.   statement loop.
  971.  
  972.   In short, it's best to use plenty of vertical spacing and blank lines.  
  973.   Also take a peek at the assembly code to see what's going on.
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.                                      15
  987.  
  988.  
  989.  
  990.  
  991.